package cec2010suite;

import ec_si_template.Config;

public final class Griewank extends ShiftedFunction{

	 /** the maximum value */
	  public static final double MAX = 600d;

	  /** the minimum value */
	  public static final double MIN = (-MAX);

	
	  public Griewank(final double[] o) {
	    super(o, MIN, MAX);
	  }

	  /**
	   * Create a default instance of F3.
	   * 
	   * @param r
	   *          the randomizer to use
	   */
	  public Griewank(final Randomizer r) {
	    this(r.createShiftVector(Defaults.DEFAULT_DIM, MIN, MAX));//
	  }

	  /**
	   * Create a default instance of F3.
	   */
	  public Griewank() {
	    this(Defaults.getRandomizer(F3.class));
	  }
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public double compute(double[] x) {
		return Kernel.griewank(x, 0, Config.dim);
	}

	@Override
	public String getFullName() {
		return "Griewank Function";
	}
}
